<html>
<head><meta charset="utf-8"><title>profiling · t-compiler/wg-polonius · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/index.html">t-compiler/wg-polonius</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html">profiling</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="164023311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164023311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164023311">(Apr 23 2019 at 19:45)</a>:</h4>
<p>Q/A for <span class="user-mention" data-user-id="218716">@lokalmatador</span></p>



<a name="164023333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164023333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164023333">(Apr 23 2019 at 19:45)</a>:</h4>
<p>OK, I've got to run but I can give one <em>very quick</em> tip =)</p>



<a name="164023482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164023482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164023482">(Apr 23 2019 at 19:47)</a>:</h4>
<p>nah it's fine, I got a pile to work off now (better read) - I'll drop a line as soon as I start doing some actual work with rustc - I thin by then the first questions will arise</p>



<a name="164023484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164023484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164023484">(Apr 23 2019 at 19:47)</a>:</h4>
<p>but thanks!</p>



<a name="164108230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164108230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164108230">(Apr 24 2019 at 18:45)</a>:</h4>
<p>So what I was going to suggest <span class="user-mention" data-user-id="218716">@lokalmatador</span> is that the <code>time</code> function can be used to "drop-in" timing measurements. <a href="https://github.com/rust-lang/rust/blob/e305df1846a6d985315917ae0c81b74af8b4e641/src/librustc_driver/lib.rs#L321-L330" target="_blank" title="https://github.com/rust-lang/rust/blob/e305df1846a6d985315917ae0c81b74af8b4e641/src/librustc_driver/lib.rs#L321-L330">Here is an example where we invoke it</a></p>



<a name="164108241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164108241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164108241">(Apr 24 2019 at 18:45)</a>:</h4>
<p>If I recall, I inserted some calls to this before to dump out timing measurements for how long it takes to borrow check each function</p>



<a name="164108425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164108425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164108425">(Apr 24 2019 at 18:47)</a>:</h4>
<p>Specifically, I think I replaced <a href="https://github.com/rust-lang/rust/blob/e305df1846a6d985315917ae0c81b74af8b4e641/src/librustc_mir/borrow_check/mod.rs#L121" target="_blank" title="https://github.com/rust-lang/rust/blob/e305df1846a6d985315917ae0c81b74af8b4e641/src/librustc_mir/borrow_check/mod.rs#L121">this line</a> with something like this:</p>
<div class="codehilite"><pre><span></span><span class="n">time</span><span class="p">(</span><span class="n">tcx</span><span class="p">.</span><span class="n">sess</span><span class="p">(),</span><span class="w"> </span><span class="n">format</span><span class="o">!</span><span class="p">(</span><span class="s">&quot;borrow_check({:?})&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">def_id</span><span class="p">),</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="n">do_mir_borrowck</span><span class="p">(...));</span><span class="w"></span>
</pre></div>



<a name="164108442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164108442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164108442">(Apr 24 2019 at 18:47)</a>:</h4>
<p>and then you can run the compiler with (I think) <code>-Ztime-passes</code> -- this is a kind of deprecated profiler, but sufficient I think for this purpose</p>



<a name="164108452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164108452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164108452">(Apr 24 2019 at 18:47)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> is working on a nice replacement and may have some suggestions</p>



<a name="164108502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164108502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164108502">(Apr 24 2019 at 18:48)</a>:</h4>
<p>maybe that new infrastructure can be used very easily here too, not sure</p>



<a name="164108513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164108513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164108513">(Apr 24 2019 at 18:48)</a>:</h4>
<p>of course you could always write your own profiler too -- we just need to take start/stop measurements dump the elapsed time, along with the <code>def_id</code></p>



<a name="164108520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164108520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164108520">(Apr 24 2019 at 18:48)</a>:</h4>
<p>we can then run this on some tests and we'll see how long each fn took</p>



<a name="164108561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164108561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164108561">(Apr 24 2019 at 18:49)</a>:</h4>
<p>one complication is that the <code>do_mir_borrowck</code> function sometimes recurses, specifically around closures...</p>



<a name="164108584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164108584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164108584">(Apr 24 2019 at 18:49)</a>:</h4>
<p>inserting that call there will measure the standard NLL borrow check, of course, not polonius -- we can then measure twice, once with polonius enabled, and compare the difference</p>



<a name="164108605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164108605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164108605">(Apr 24 2019 at 18:49)</a>:</h4>
<p>in fact, I wonder if it's easier to just insert some <code>eprintln!</code> calls (or perhaps <code>info!</code> or something so they don't print by default) and post-process the data with a quick script</p>



<a name="164108612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164108612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164108612">(Apr 24 2019 at 18:49)</a>:</h4>
<p>that would let us readily handle the recursive case</p>



<a name="164108673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164108673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164108673">(Apr 24 2019 at 18:50)</a>:</h4>
<p>e.g., print out a start stamp / end stamp</p>



<a name="164110238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164110238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164110238">(Apr 24 2019 at 19:04)</a>:</h4>
<p>ok, thanks for elaborating</p>



<a name="164110390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164110390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164110390">(Apr 24 2019 at 19:06)</a>:</h4>
<p>I suppose it'd be nice if we could have some kind of code that we can check-in, such that we can readily generate spreadsheets etc in the future</p>



<a name="164110406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164110406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164110406">(Apr 24 2019 at 19:06)</a>:</h4>
<p>yup</p>



<a name="164110415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164110415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164110415">(Apr 24 2019 at 19:06)</a>:</h4>
<p>(one easy way to do this would be to have the compiler self-profile and to generate <code>debug!</code> statements that we can grep for)</p>



<a name="164110434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164110434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164110434">(Apr 24 2019 at 19:06)</a>:</h4>
<p>although hmm</p>



<a name="164110440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164110440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164110440">(Apr 24 2019 at 19:07)</a>:</h4>
<p>so if it just generates <code>debug!</code> statements at specific points</p>



<a name="164110454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164110454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164110454">(Apr 24 2019 at 19:07)</a>:</h4>
<p>we can check-in the scripts to post-process that output into the polonius repo</p>



<a name="164110470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164110470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164110470">(Apr 24 2019 at 19:07)</a>:</h4>
<p>that seems like a good enough setup too</p>



<a name="164111053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164111053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164111053">(Apr 24 2019 at 19:15)</a>:</h4>
<p>If you want to use <code>-Z self-profile</code>, the easiest thing to do would be to call the <code>start_activity()</code> and <code>end_activity()</code> methods on the <code>SelfProfiler</code>  which can take arbitrary strings. Here's an example:</p>
<p><a href="https://github.com/rust-lang/rust/blob/31f5d69ba4f4d78740190a08ea097b41b00d96cb/src/librustc_interface/passes.rs#L72-L80" target="_blank" title="https://github.com/rust-lang/rust/blob/31f5d69ba4f4d78740190a08ea097b41b00d96cb/src/librustc_interface/passes.rs#L72-L80">https://github.com/rust-lang/rust/blob/31f5d69ba4f4d78740190a08ea097b41b00d96cb/src/librustc_interface/passes.rs#L72-L80</a></p>



<a name="164111208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164111208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164111208">(Apr 24 2019 at 19:17)</a>:</h4>
<p>The tooling here is currently kind of basic but after you've made that change, you'll need to build rustc, then run it with the <code>-Z self-profile</code> flag. You'll get three output files in your working directory. From there, you can use the tool in <a href="https://github.com/rust-lang/measureme/pull/17" target="_blank" title="https://github.com/rust-lang/measureme/pull/17">this PR</a> to get timing data out of those binary files</p>



<a name="164111314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164111314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164111314">(Apr 24 2019 at 19:18)</a>:</h4>
<p>The self-profiler should correctly handle the recursive case so you don't need to do anything there.</p>



<a name="164111337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164111337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164111337">(Apr 24 2019 at 19:18)</a>:</h4>
<p>I see. Thanks for the info!</p>



<a name="164111396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164111396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164111396">(Apr 24 2019 at 19:19)</a>:</h4>
<p>Let me know if you decide to go that route and have questions. I'd be happy to answer them or help you get unstuck.</p>



<a name="164113353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/164113353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#164113353">(Apr 24 2019 at 19:43)</a>:</h4>
<p>That might be the right thing then</p>



<a name="166400330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166400330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166400330">(May 23 2019 at 21:09)</a>:</h4>
<p>alright</p>



<a name="166400364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166400364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166400364">(May 23 2019 at 21:09)</a>:</h4>
<p>so I dug around the last coupla days I think I found the locations where profiling for polonius should be done</p>



<a name="166400526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166400526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166400526">(May 23 2019 at 21:11)</a>:</h4>
<p>this is what I changed: <a href="https://github.com/lokalmatador/rust/commit/3953fa1a48e9bf08b9ee729a7d3d2dacee5ffd95" target="_blank" title="https://github.com/lokalmatador/rust/commit/3953fa1a48e9bf08b9ee729a7d3d2dacee5ffd95">https://github.com/lokalmatador/rust/commit/3953fa1a48e9bf08b9ee729a7d3d2dacee5ffd95</a></p>



<a name="166400547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166400547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166400547">(May 23 2019 at 21:12)</a>:</h4>
<p>everything compiles and using it seems to output some profiling data for the statements I added, but now I'm stuck with measureme</p>



<a name="166400596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166400596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166400596">(May 23 2019 at 21:12)</a>:</h4>
<p>cloned it (today) and compiled it and now I get that</p>



<a name="166400616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166400616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166400616">(May 23 2019 at 21:12)</a>:</h4>
<p><code>thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `"GenericActivity"`,
 right: `"Query"`', summarize/src/analysis.rs:150:17</code></p>



<a name="166400627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166400627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166400627">(May 23 2019 at 21:12)</a>:</h4>
<p>maybe <span class="user-mention" data-user-id="125250">@Wesley Wiser</span>  has an idea why this happens?</p>



<a name="166400658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166400658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166400658">(May 23 2019 at 21:13)</a>:</h4>
<p>also, <span class="user-mention" data-user-id="116009">@nikomatsakis</span> , is this what you inteded with profiling? and also, are the locations correct?</p>



<a name="166401318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166401318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166401318">(May 23 2019 at 21:22)</a>:</h4>
<p>I can tell you <em>what's</em> happening but I don't know <em>why</em>.</p>
<p>Profiler events get recorded as either a Start event or a Stop event and then an event type.</p>
<p>When the summarization tool runs, it keeps of stack of events that happen per thread. When a Stop event gets processed, we look at the previous event on the stack and make sure it matches the event we're currently processing.</p>
<p>In this case, that assertion is failing. Based on the message, the last Start event we saw on this thread was for a "GenericActivity" event type but now the Stop event we're processing is for a "Query" event type.</p>



<a name="166401361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166401361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166401361">(May 23 2019 at 21:23)</a>:</h4>
<p>It almost looks like there's event missing from the file but that shouldn't happen and I've never seen it</p>



<a name="166401380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166401380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166401380">(May 23 2019 at 21:23)</a>:</h4>
<p>How big is your <code>.events</code> file?</p>



<a name="166401485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166401485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166401485">(May 23 2019 at 21:24)</a>:</h4>
<p>308K</p>



<a name="166401699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166401699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166401699">(May 23 2019 at 21:27)</a>:</h4>
<p>Can you file a bug report on <a href="https://github.com/rust-lang/measureme" target="_blank" title="https://github.com/rust-lang/measureme">https://github.com/rust-lang/measureme</a> ?</p>



<a name="166401707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166401707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166401707">(May 23 2019 at 21:27)</a>:</h4>
<p>And include all three files</p>



<a name="166401796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166401796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166401796">(May 23 2019 at 21:28)</a>:</h4>
<p>Thanks!</p>



<a name="166401867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166401867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166401867">(May 23 2019 at 21:29)</a>:</h4>
<p>sure</p>



<a name="166404050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166404050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166404050">(May 23 2019 at 21:58)</a>:</h4>
<blockquote>
<p>Can you file a bug report on <a href="https://github.com/rust-lang/measureme" target="_blank" title="https://github.com/rust-lang/measureme">https://github.com/rust-lang/measureme</a> ?</p>
</blockquote>
<p>done - though I could not add a proper label...</p>



<a name="166718144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166718144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166718144">(May 28 2019 at 13:44)</a>:</h4>
<p><span class="user-mention" data-user-id="218716">@lokalmatador</span> that looks like what I intended, yes. It's a bit of an underestimate in that it's only profiling the cost of "inner loop" of polonius and not the cost of generating the facts themselves, but it'd still be useful data.</p>



<a name="166718161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166718161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166718161">(May 28 2019 at 13:44)</a>:</h4>
<p>Did you ever figure out what was going wrong with measureme?</p>



<a name="166730482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166730482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166730482">(May 28 2019 at 15:54)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="218716">lokalmatador</span> that looks like what I intended, yes. It's a bit of an underestimate in that it's only profiling the cost of "inner loop" of polonius and not the cost of generating the facts themselves, but it'd still be useful data.</p>
</blockquote>
<p>I see. For my understanding: Polonius uses the same facts as NLL, right?</p>



<a name="166730561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166730561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166730561">(May 28 2019 at 15:55)</a>:</h4>
<p>so it boils down to also profile NLL's fact generation</p>



<a name="166746701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166746701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166746701">(May 28 2019 at 18:43)</a>:</h4>
<p><span class="user-mention" data-user-id="218716">@lokalmatador</span> More or less, there are some Polonius-specific fact generation steps, notably an entire MIR traversal to extract variable uses, but I can't remember if that's in the code you're profiling yet. I think I remember a nested loop doing some sort of Polonius-only work somewhere in <code>trace::trace()</code>as well.</p>



<a name="166746830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166746830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166746830">(May 28 2019 at 18:44)</a>:</h4>
<p>But it's heavily piggy-backing off of NLL's calculations as far as I can tell</p>



<a name="166989866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/166989866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#166989866">(May 31 2019 at 11:48)</a>:</h4>
<p><span class="user-mention" data-user-id="218716">@lokalmatador</span> The issue with <code>measureme</code> is that <a href="https://github.com/lokalmatador/rust/commit/3953fa1a48e9bf08b9ee729a7d3d2dacee5ffd95#diff-cce7509357d5dcbb2c3bd87102f77005R213" target="_blank" title="https://github.com/lokalmatador/rust/commit/3953fa1a48e9bf08b9ee729a7d3d2dacee5ffd95#diff-cce7509357d5dcbb2c3bd87102f77005R213">this line</a> in your diff should use <code>end_activity</code> instead of <code>start_activity</code>.</p>



<a name="167059165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/167059165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#167059165">(Jun 01 2019 at 06:56)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="218716">lokalmatador</span> The issue with <code>measureme</code> is that <a href="https://github.com/lokalmatador/rust/commit/3953fa1a48e9bf08b9ee729a7d3d2dacee5ffd95#diff-cce7509357d5dcbb2c3bd87102f77005R213" target="_blank" title="https://github.com/lokalmatador/rust/commit/3953fa1a48e9bf08b9ee729a7d3d2dacee5ffd95#diff-cce7509357d5dcbb2c3bd87102f77005R213">this line</a> in your diff should use <code>end_activity</code> instead of <code>start_activity</code>.</p>
</blockquote>
<p>hey <span class="user-mention" data-user-id="125250">@Wesley Wiser</span>,  just saw it on github. Totally my bad, sorry for bothering with that stupid question :D I'll proof read my code thrice from now on ;) Anyways, thanks for clarifying!</p>



<a name="167069541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/167069541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#167069541">(Jun 01 2019 at 11:59)</a>:</h4>
<p><span class="user-mention" data-user-id="218716">@lokalmatador</span> No worries! I had to look through your diff twice before I spotted it myself <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="168863174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168863174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168863174">(Jun 24 2019 at 16:16)</a>:</h4>
<p>hm, to whoever stumbles upon this (but maybe <span class="user-mention" data-user-id="116009">@nikomatsakis</span> wants to reply), at the beginning we at some point talked about also dumping tuple counts</p>



<a name="168863299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168863299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168863299">(Jun 24 2019 at 16:18)</a>:</h4>
<p>1. so do we still want to do this?<br>
2. that seems a little trickier as I cannot reuse the profiling stuff which is there - well I could by dumping some string that contains the number of tuples if this is ok, but in an ideal world, we probably want something else; could the NLL fact dumping stuff be reused?</p>



<a name="168863308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168863308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168863308">(Jun 24 2019 at 16:18)</a>:</h4>
<p>just trying to avoid to introduce too much new stuff somehow...</p>



<a name="168863335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168863335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168863335">(Jun 24 2019 at 16:19)</a>:</h4>
<p>no need to discuss now, but tomorrow maybe</p>



<a name="168864667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168864667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168864667">(Jun 24 2019 at 16:40)</a>:</h4>
<p>in the meantime, I'll continue playing with rustc-perf and give some benchmarks a shot</p>



<a name="168874891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168874891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168874891">(Jun 24 2019 at 18:46)</a>:</h4>
<p>well the tuple counts we can also get very easily just by inspecting the output</p>



<a name="168874910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168874910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168874910">(Jun 24 2019 at 18:46)</a>:</h4>
<p>I guess I think we *may want to do it</p>



<a name="168874915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168874915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168874915">(Jun 24 2019 at 18:46)</a>:</h4>
<p>I'm trying to remember</p>



<a name="168874942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168874942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168874942">(Jun 24 2019 at 18:47)</a>:</h4>
<p>I think my main motivation was being able to correlate timing with tuple counts maybe?</p>



<a name="168874949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168874949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168874949">(Jun 24 2019 at 18:47)</a>:</h4>
<p>starting with just timing seems ok</p>



<a name="168875094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168875094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168875094">(Jun 24 2019 at 18:49)</a>:</h4>
<blockquote>
<p>I think my main motivation was being able to correlate timing with tuple counts maybe?</p>
</blockquote>
<p>that sounds very reasonable</p>



<a name="168875115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168875115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168875115">(Jun 24 2019 at 18:49)</a>:</h4>
<p>ok, then I'll focus on the timing for now</p>



<a name="168878855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168878855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168878855">(Jun 24 2019 at 19:40)</a>:</h4>
<p>I don't think this is useful for you yet <span class="user-mention" data-user-id="218716">@lokalmatador</span>, but as part of my work for my thesis, I have collected about 17 000 Git repositories containing Rust code that compiles with Nightly Rust (selected by number of Github stars and downloads on <a href="http://crates.io" target="_blank" title="http://crates.io">crates.io</a>), and have now generated around 70 GB of Polonius inputs from them. I plan on doing a quick tuple count and run Polonius against them and see how the correlations look. :)</p>



<a name="168878968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168878968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168878968">(Jun 24 2019 at 19:42)</a>:</h4>
<p>(this is an excuse to have more colourful graphs in my report)</p>



<a name="168879000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168879000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168879000">(Jun 24 2019 at 19:42)</a>:</h4>
<p>Ah, apparently I have inputs from roughly 1700 repositories, or precisely 789 658 functions.</p>



<a name="168879057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168879057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168879057">(Jun 24 2019 at 19:43)</a>:</h4>
<p>(I do all of this from Python scripts like an animal)</p>



<a name="168880369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168880369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168880369">(Jun 24 2019 at 20:00)</a>:</h4>
<p>(yeah we can always add these tuple counts/graph/correlate them later  — interestingly enough, we might also be able to dump them with datafrog;  it'll also dump the whole counts at each iteration of the computation, including outputs and intermediate relations, not just inputs, using <a href="https://github.com/rust-lang/datafrog/pull/21" target="_blank" title="https://github.com/rust-lang/datafrog/pull/21">this</a>  — but polonius doesn't use this rev of datafrog yet though IIRC)</p>



<a name="168914674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/168914674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lokalmatador <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#168914674">(Jun 25 2019 at 07:06)</a>:</h4>
<blockquote>
<p>I don't think this is useful for you yet <span class="user-mention silent" data-user-id="218716">lokalmatador</span>, but as part of my work for my thesis, I have collected about 17 000 Git repositories containing Rust code that compiles with Nightly Rust (selected by number of Github stars and downloads on <a href="http://crates.io" target="_blank" title="http://crates.io">crates.io</a>), and have now generated around 70 GB of Polonius inputs from them. I plan on doing a quick tuple count and run Polonius against them and see how the correlations look. :)</p>
</blockquote>
<p>wow, that's a lot :D <br>
yeah maybe we can briefly talk about it tonite if it makes sense for me to reuse it</p>



<a name="169388870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/profiling/near/169388870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/profiling.html#169388870">(Jul 01 2019 at 12:00)</a>:</h4>
<p>Here's <a href="/user_uploads/4715/4B3a82Cpj8PCR44PRmQQGTyc/pasted_image.png" target="_blank" title="pasted_image.png">a heatmap of inputs affecting solve-time for rougly 789 000 functions from popular crates </a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/4B3a82Cpj8PCR44PRmQQGTyc/pasted_image.png" target="_blank" title="a heatmap of inputs affecting solve-time for rougly 789 000 functions from popular crates "><img src="/user_uploads/4715/4B3a82Cpj8PCR44PRmQQGTyc/pasted_image.png"></a></div>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>